﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_ORDER_INSERT')
	BEGIN
		DROP  Procedure  P_ORDER_INSERT
	END

GO

CREATE Procedure P_ORDER_INSERT
	(
		@p_order_id			VARCHAR(50),
		@p_ordered_by		VARCHAR(50),
		@p_total_price			DECIMAL,
		@p_user_name		NVARCHAR(50),
		@p_transacion_id	VARCHAR(50)
	)


AS
INSERT INTO [PetShop].[dbo].[T_ORDER]
           ([ORDER_ID]
           ,[ORDER_DATE]
           ,[ORDER_TOTAL_PRICE]
           ,[ORDERED_BY]
           ,[TRANSACTION_ID]
           ,[CREATED_BY]
           ,[CREATED_TIME]
           ,[LAST_UPDATED_BY]
           ,[LAST_UPDATED_TIME])
     VALUES
           (@p_order_id
           ,GETDATE()
           ,@p_total_price
           ,@P_ordered_by
           ,@p_transacion_id
           ,@p_user_name
           ,GETDATE()
           ,@p_user_name
           ,GETDATE())
GO
